#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/times.h>
#include <time.h>
#include <sys/time.h>
#include <math.h>
#include <unistd.h>

#ifndef CLK_TCK
#define CLK_TCK 100
#endif

double getime()
{
  struct tms use;
  double tmp;

  tmp = times(&use);
  tmp = (double)use.tms_utime;

  /* tmp += use.tms_stime; */
  return (double)(tmp) / CLK_TCK;

  // printf("tmp = %11.3e\n", tmp);
  // return (double)(tmp);
}  

int main(int* argc, char** argv){
  double t0, t1;
  double test;
  int i;
  long myclktck;
  int maxiter;
  
  maxiter = 10000000;
  myclktck = sysconf(_SC_CLK_TCK);
  t0 = getime();
  for(i = 0; i < maxiter; i++)
    test = exp(-(double)(i)/maxiter);
  t1 = getime();
  printf("myclktck= %11.3e\n ", (double)myclktck);
  printf("time passed = %11.3e\n ", (t1 - t0));
}



